package com.zbw.common.service;

import com.zbw.common.entity.Book;
import com.zbw.common.entity.BookCategory;
import com.zbw.common.entity.BookComment;
import com.zbw.common.entity.BookIndex;
import io.github.xxyopen.model.resp.RestResult;

import java.util.List;

public interface FrontBookService {
    Book selectBook(Long bid);

//    PageBean<BookCommentVO> selectComment(Long userid, Long bookId, int num, int size);
    //增加点击量
    void addVisitCount(Long bookId, int i);
    //
    List<Book> listRecBooks(Integer catId);

    List<Book> listRank(Byte type, Integer limit);

    List<BookCategory> listBookCategory();

    Long queryIndexCount(Long bookId);

    BookIndex queryBookIndex(Long lastBookIndexId);

    Long queryPreBookIndexId(Long bookId, Integer indexNum);

    Long queryNextBookIndexId(Long bookId, Integer indexNum);

    List<BookIndex> queryIndexList(Long bookId,  String orderby,
                                   Integer page,  Integer pagesize);
    /**
     * 发布小说
     * @param book 小说信息
     * @param authorId 作家ID
     * @param penName 作家笔名
     * */
    RestResult<?> addBook(Book book, Long authorId, String penName);

    /**
     * 更新小说状态,上架或下架
     * @param bookId 小说ID
     * @param status 更新的状态
     * @param authorId 作者ID
     * */
    void updateBookStatus(Long bookId, Byte status, Long authorId);




     Long queryIdByNameAndAuthor(String bookName, String author);
    /**
     * 发布章节内容
     * @param bookId 小说ID
     * @param indexName 章节名
     * @param content 章节内容
     * @param isVip 是否收费
     * @param authorId 作者ID   */
    void addBookContent(Long bookId, String indexName, String content, Byte isVip, Long authorId);

    void deleteIndex(Long indexId, Long bookId);

    void updateIndexName(Long indexId, String indexName, Long bookId);

    void updateBookContent(Long indexId, String indexName, String content, Long authorId);

    void updateBookPic(Long bookId, String bookPic, Long authorId);

    String queryIndexContent(Long indexId, Long authorId);

    void addBookComment(Long id, BookComment comment);
}
